#pragma once

// Copyright (c) 2010 Manuel Peinado Gallego <manuel.peinado@gmail.com>
// Distributed under the MIT license


#include <alg3d/alg3d.h>


class Quad
{
public:
    Quad();
    Quad(const gx::Vec3 & v0, const gx::Vec3 & v1, 
        const gx::Vec3 & v2, const gx::Vec3 & v3);
    gx::Vec3 v0, v1, v2, v3;
    // TODO make Block::getFace return a Quad, not an array of two triangles
    // TODO make rayIntersection in terms of quads, using Triangle::rayIntersection internally
    // TODO use Quad::rayIntersection for picking instead of Triangle::rayIntersection with the array of two tris
    //int rayIntersection(const Ray & ray, gx::Vec3 & interPnt) const;
    gx::Vec3 computeNormal(void) const;
    gx::Vec3 getCenter(void) const;
    void move(const gx::Vec3 & offset);
};

void drawQuad(const Quad & q);
void drawWireQuad(const Quad & q);
